﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<IEnumerable<ChungNhanSinhVien.Entities.ChungNhan>>" %>
<%using (Html.BeginForm())
  {
      
      %>
<table cellspacing="0" cellpadding="2" style="width: 100%; border: medium outset" align=center>
    <tr>
        <td colspan=3 style=" color:#588437; font-weight:bold" ><h3>Danh sách chứng nhận</h3></td>
        <td align="right">
            <%:Html.ActionLink("Tạo mới","TaoMoiCN","Ad_ChungNhan") %>
        </td>
    </tr>
    <tr style="border: medium outset; background-color: #588437; font-weight: bold; color: White" align="center">
        <td style="width: 10%;border: medium outset;" >
            Mã CN
        </td>
        <td style="width: 30%;border: medium outset;">
            Tên chứng nhận
        </td>
        <td style="border: medium outset;">
            Nội dung
        </td >
        <td style="width: 10%;border: medium outset;">
            Thao tác
        </td>
    </tr>
    <%if (Model != null)
          foreach (var item in Model)
          {
              if (Model.ToList().IndexOf(item) % 2 == 0)
              {%>
    <tr style="background-color:#E8EBA4;">
        <td align="center" style="border: medium outset;">
            <%:item.ID %>
        </td>
        <td style="border: medium outset;">
            <%:item.TenChungNhan %>
        </td>
        <td style="border: medium outset;">
            <%:item.NoiDungChungNhan %>
        </td>
        <td style="border: medium outset;"align=center>
            <%:Html.ActionLink("Sửa","SuaCN","Ad_ChungNhan",new {id = item.ID}, new {@class="al-edit", @title="Sửa"}) %>
            <%:Html.ActionLink("Xóa","XoaCN","Ad_ChungNhan",new {id = item.ID}, new {@class="al-delete", @title="Xóa"}) %>
        </td>
    </tr>
    <%
              }

              else
              {%>
    <tr style="background-color:#9BBB59;">
        <td align="center" style="border: medium outset;">
            <%:item.ID %>
        </td>
        <td style="border: medium outset;">
            <%:item.TenChungNhan %>
        </td>
        <td style="border: medium outset;">
            <%:item.NoiDungChungNhan %>
        </td>
        <td style="border: medium outset;" align=center>
            <%:Html.ActionLink("Sửa","SuaCN","Ad_ChungNhan",new {id = item.ID}, new {@class="al-edit", @title="Sửa"}) %>
            <%:Html.ActionLink("Xóa","XoaCN","Ad_ChungNhan",new {id = item.ID}, new {@class="al-delete", @title="Xóa"}) %>
        </td>
    </tr>
    <%
}
          } %>
</table>
<%} %>